import 'package:flutter/material.dart';


///route演示的主界面

class RouteMain extends StatelessWidget {
  const RouteMain({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("路由演示的主界面"),
        centerTitle: true,
        elevation: 10.0,
      ),
      body: Center(
        child: Column(
          children: [
            SizedBox(
              height: 20,
            ),
            RaisedButton(
              onPressed: () {
                Navigator.pushNamed(context, "route1");
              },
              child: Text("路由演示1： 相互传值：异步"),
            ),
            RaisedButton(
              onPressed: () {
                Navigator.pushNamed(context, "route2");
              },
              child: Text("路由演示2： 相互传值进阶：路由传参"),
            )
          ],
        ),
      ),
    );
  }
}
